{* Smarty *}
{literal}

<script>
	function submitWithAction(action, selectBox)
	{
			var actionString;

			if (selectBox)
			{
					if (selectBox.selectedIndex == '')
					{
							return false;
					}
					actionString = action + '|' + selectBox.options[selectBox.selectedIndex].text;
			}
			else
			{
					actionString = action;
			}

			document.commands.action.value = actionString;
		//	alert(document.commands.action.value);
			document.commands.submit();
	}
</script>

{/literal}

<div id="main_header">{t}{$command}{/t}</div>
{if !empty($msg)}
	<div id="error"><tt>{$msg}</tt></div>
{/if}
<div class="box">
	<form action="/admin/modules/default_commands" method="post" name="commands">
	<input name="action" type="hidden" value="" />
	<table cellspacing="0">
		<caption>{t}module status caption{/t}</caption>
		<tr>
			<th width="10%" class="left">{t}name{/t}</th>
			<th width="50%" class="left">{t}description{/t}</th>
			<th width="30%">{t}Default command{/t}</th>
		</tr>
		{foreach from=$modules item=data key=module}
		<tr>
			<td width="10%" class="module_name">{$module}</td>
		  {foreach from=$data item=perms key=desc}
			<td width="70%" class="module_desc">{$desc}</td>
			<td width="30%" class="left">
				<select name="{$module}" onchange=submitWithAction("{$module}",this)>
					 {html_options values=$perms options=$perms selected="default"}
				</select>
			</td>
			{/foreach}
		</tr>
		{/foreach}
	</table>
	</form>
</div>